package com.blb.proxy;

/**
 * @author lvtian
 * @date 2022/12/28 10:02
 */
public class SalesProxyTest {
    public static void main(String[] args) {
        CellphoneSale cellphoneSale = new CellphoneFactory();
        ComputerSale computerSale = new ComputerFactory();
        CarFactory carFactory = new CarFactory();
//        JDKSalesProxy proxy = new JDKSalesProxy();
        CGlibSalesProxy proxy = new CGlibSalesProxy();
//        CellphoneSale cellPhoneProxy = (CellphoneSale) proxy.crateProxy(cellphoneSale);
        ComputerSale computerSell = (ComputerSale) proxy.createProxy(computerSale);
//        cellPhoneProxy.sellCellPhone("华为13Promax");
        computerSell.sellComputer("Dell");
        CarFactory car = (CarFactory) proxy.createProxy(carFactory);
        car.Car("保时捷");
    }
}
